package com.tarena.lbs.business.controller;

import com.tarena.lbs.base.protocol.model.Result;
import com.tarena.lbs.business.pojo.po.BusinessCategoryPO;
import com.tarena.lbs.business.pojo.query.BusinessCategoryQuery;
import com.tarena.lbs.business.pojo.vo.BusinessCategoryVO;
import com.tarena.lbs.business.servcie.BusinessCategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Tag(name = "商家分类相关功能接口")
@RestController
@Slf4j
public class BusinessCategoryController {
    @Autowired
    private BusinessCategoryService businessCategoryService;
    @Operation(summary = "查询所有分类")
    @GetMapping("/admin/basic/business/category/list/")
    public Result<List<BusinessCategoryVO>> allCategories(BusinessCategoryQuery  query){
        log.info("查询所有分类");
        List<BusinessCategoryVO> list =businessCategoryService.allCategories(query);
        return new Result<>(list);
    }

}
